package com.zlwl.sjgj.other;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.zlwl.sjgj.frame.HttpUtil;
import com.zlwl.sjgj.frame.UtilException;

public class FindByKey
{
    private static  List<String> list = new ArrayList<String>();
    
    static {
        list.add("http://10.211.93.39:8099/miguqa/docs/iServer.html");
        list.add("http://10.211.93.39:8099/miguqa/docs/aServer.html");
        list.add("http://10.211.93.39:8099/miguqa/docs/cServer.html");
        list.add("http://10.211.93.39:8099/miguqa/docs/duiba.html");
        list.add("http://10.211.93.39:8099/miguqa/docs/csu.html");
        list.add("http://10.211.93.39:8099/miguqa/docs/ctu.html");   
    }
    public static void main(String[] args)
    {
        try
        {
            for (String url : list)
            {
                HttpResponse response = HttpUtil.getMethod(url);
                System.out.println(response.getStatusLine().getStatusCode());
                String body = HttpUtil.getResult(response).toString();
                //System.out.println(body);
                //FileUtil.writeString(body, "a.txt");
                Document doc = Jsoup.parse(body);
                //HttpUtil.getTable(doc,"msisdn");
                HttpUtil.getinterfacename(doc, "");
            }
            
        }
        catch (ClientProtocolException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (UtilException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
    
}
